package com.example.yiqiuser.controller;


import com.example.yiqiuser.entity.TScenicStrategy;
import com.example.yiqiuser.service.TScenicStrategyService;
import com.example.yiqiuser.util.Page;
import com.example.yiqiuser.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ：周文达
 * @date ：Created in 2023/3/31 11:13
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("tss")
public class TScenicStrategyController extends BaseController {
    @Resource
    private TScenicStrategyService tScenicStrategyService;

    @PostMapping("query")
    public Result queryPage(@RequestBody Page<TScenicStrategy> page) {
        return success(tScenicStrategyService.queryByParam(page));
    }

    @PostMapping("queryById")
    public Result queryById( Integer scenicId) {
        return success(tScenicStrategyService.queryById(scenicId));
    }

    @PostMapping("queryAll")
    public Result queryById() {
        return success(tScenicStrategyService.queryAll());
    }

    @PostMapping("add")
    public Result add(@RequestBody TScenicStrategy tScenicStrategy) {
        return success(tScenicStrategyService.add(tScenicStrategy));
    }

    @DeleteMapping("delete")
    public Result deleteById(Integer scenicId) {
        return success(tScenicStrategyService.deleteById(scenicId));
    }

    @PostMapping("update")
    public Result update(@RequestBody TScenicStrategy tScenicStrategy) {
        return success(tScenicStrategyService.update(tScenicStrategy));
    }

}